import Cookies from 'js-cookie'

// const TokenKey = 'Admin-Token'

export function getToken() {
  let getKey = localStorage.getItem('TokenKey')
  if(getKey){
    return Cookies.get(getKey || null)
  }
}

export function setToken(token) {
  localStorage.setItem('TokenKey',token.key)
  return Cookies.set(token.key, token.val)
}

export function removeToken() {
  let getKey = localStorage.getItem('TokenKey')
  if(getKey){
    return Cookies.remove(getKey)
  }
}
